package com.mida.bms.report.controller;

import com.mida.bms.report.service.DocStructTemplateInfoService;
import com.mida.bms.report.service.DocSupportAreaService;
import com.mida.bms.report.vo.DocStructRequestVo;
import com.mida.bms.report.vo.PatientInfoParameterVo;
import com.mida.tool.common.result.ListResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 佐证区
 */
@RestController
@RequestMapping("/docSupportArea")
@CrossOrigin
@Slf4j
public class DocSupportAreaController {

    @Autowired
    private DocSupportAreaService docSupportAreaService;

    /**
     *  获取检查报告报告相关详情
     *
     * @param
     * @return
     */
    @PostMapping(value = "/getDocSupportContentList", produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    public ListResult<List<DocStructRequestVo>> getDocSupportContentList(
            @RequestBody PatientInfoParameterVo vo) {
        ListResult result = new ListResult();
        try {
            return docSupportAreaService.getDocSupportContentList(vo);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            result.setStatus(HttpStatus.BAD_REQUEST.value());
            result.setMessage("添加模版基本信息失败");
            return result;
        }
    }
}
